package fjh.Interface;
import java.util.Scanner;
public class Compute_Test {

    static Scanner input=new Scanner(System.in);
    public static void main(String[] args) {
        Compute plus=null;

        UseCompute use=new UseCompute();
        System.out.print("请输入左操作数：");
        int one=input.nextInt();
        System.out.print("请输入右操作数：");
        int two=input.nextInt();
        System.out.print("请输入运算符（+ - * /）：");
        char ch=input.next().charAt(0);
        switch (ch)
        {
            case '+':
                plus=new Plus();
                break;
            case '-':
                plus=new Sub();
                break;
            case '*':
                plus=new Mul();
                break;
            case '/':
                plus=new Div();
                break;
            default:
                System.out.println("运算符错误！");
                System.exit(1);
        }
        use.useCom(plus,one,two);
    }
}
